import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders, HttpClientJsonpModule } from '@angular/common/http';

@Component({
  selector: 'app-zhuce',
  templateUrl: './zhuce.component.html',
  styleUrls: ['./zhuce.component.css']
})
export class ZhuceComponent implements OnInit {
  private signuppeopleInfo: any = {
    username: '',
    email: '',
    mima: ''
  }
  private list:any[]=[];

  constructor(public Http: HttpClient) { }

  ngOnInit() {
  }
  search() {
    console.log(this.signuppeopleInfo);
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json;charset=UTF-8',
        'Access-Control-Allow-Origin': '*',
      })
    };
    var api = "http://10.100.185.117:4200/register";
    this.Http.post(api, this.signuppeopleInfo, httpOptions).subscribe((response: any) => {

      console.log(response);
      
      alert(response.register1[0].register);
    })
  }

}
